#pragma once

#include "fxcc/core/audio/common/AudioImporter.h"
#include "fxcc/core/graph/common/TextureImporter.h"
#include "fxcc/core/graph/common/ModelImporter.h"
//#include "fxcc/core/graph/opengl3/ShaderImporter.h"
//#include "fxcc/core/graph/opengl3/ShaderLoader.h"

#include "fxcc/core/graph/common/ModelLoader.h"
#include "fxcc/core/graph/common/EffectsLoader.h"
#include "fxcc/core/graph/common/TextureLoader.h"
#include "fxcc/core/audio/common/AudioLoader.h"
#include "fxcc/core/graph/common/ShaderImporter.h"
#include "fxcc/core/graph/common/ShaderLoader.h"
#include "fxcc/core/graph/common/ActorLoader.h"

#include "fxcc/mono/CSharpImporter.h"
#include "fxcc/mono/CSharpLoader.h"

#include "e2d/ui/PrefebImporter.h"
#include "e2d/ui/PrefebLoader.h"

#include "e2d/ui/GameManager.h"
#include "e2d/ui/State.h"

#include "e2d/core/Inst.h"

#include <thread>



namespace e2d
{

	struct Utils
	{

		static std::string m_CachePath;

		static fxcc::Cache m_Cache;

		static e2d::GameManager m_GameManager;

		static Inst m_Inst;

		// Importer
		static ModelImporter m_ModelImporter;

		static AudioImporter m_AudioImporter;

		static TextureImporter m_TextureImporter;

		static CSharpImpoter m_CSharpImporter;

		static PrefebImporter m_PrefebImporter;
		
		static ShaderImporter m_ShaderImporter;

		// Loader
		static ModelLoader m_ModelLoader;

		static AudioLoader m_AudioLoader;

		static TextureLoader m_TextureLoader;
		
		static ActorLoader m_ActorLoader;

		static CSharpLoader m_CSharpLoader;

		static PrefebLoader m_PrefebLoader;

		static ShaderLoader m_ShaderLoader;

		static EffectsLoader m_EffectsLoader;

		static bool ImportDirectory(const fxcc::Dir& dir);
		
		static bool InitLoader();

		static void InitGameManager();

		static bool SaveMetaCache();

		static bool LoadDirectory(const fxcc::Dir& dir);

		static bool LoadShaderDir(const fxcc::Dir& dir);

		static bool LoadRealMaterial(const fxcc::Dir& dir);

		static bool LoadFile(const fxcc::File& file);
		
		static bool LoadMetaCache();

		static void OnDestroy();
		
		static bool LoadLastInstance();
	
		static void OnLoadData(const std::string& path);

		static void OnSaveData();
		
		static void SetSceneFromInst();

		static void OnRenderFrame();

		static void NewInstance();

		static void InitAudioWorld();

	};
};
